package com.adingxiong.cft.design.abstractfactory;

/**
 * @ClassName FactoryProduce
 * @Description 创建一个工厂创造器/生成器类，通过传递形状或颜色信息来获取工厂。
 * @Author xiongchao
 * @Date 2021/1/7 15:30
 **/
public class FactoryProduce {

    public static AbstractFactory getFactroy(String choice) {
        if(choice.equalsIgnoreCase("color")){
            return new ColorFactory();
        }else if (choice.equalsIgnoreCase("shape")){
            return new ShapeFactory();
        } else {
            return null;
        }
    }
}
